/************************************************************************************************************
(C) www.dhtmlgoodies.com, October 2005
www.dhtmlgoodies.com
Alf Magne Kalleland
************************************************************************************************************/
var ajax = new sack();
var contentObj;

var ajaxlookup = new sack();
function getAjaxFileOLD(fileName)
{
	ajaxlookup.requestFile = '/authlookup.php?'+sessionID;	// Specifying which file to get
	ajaxlookup.onCompletion = showAuthInfoData(fileName);	// Specify function that will be executed after file has been found
	ajaxlookup.runAJAX();		// Execute AJAX function			
}

function showAuthInfoData(fileName)
{
	if (ajaxlookup.response == "logout") {
		document.location.href = '/login.php';
	} else {
		getPostAjaxFile(fileName);
	}
}


function showContent()	// Displaying content in the content <div>
{
	contentObj.innerHTML = ajax.response;	// ajax.response is a variable that contains the content of the external file	
}

function showWaitMessage()
{
	contentObj.innerHTML = showWaitMessageStr;
}

function getAjaxFile(fileName)
{
	ajax.requestFile = fileName;	// Specifying which file to get
	ajax.onCompletion = showContent;	// Specify function that will be executed after file has been found
	ajax.onLoading = showWaitMessage;	// Action when AJAX is loading the file
	ajax.runAJAX();		// Execute AJAX function	
}


function initAjaxWindow()
{
	contentObj = document.getElementById('contentContainer');
}
window.onload = initAjaxWindow;